/**
 * 
 */
let bussiness = new Vue({
	el:'#bussiness',
	data:{
		userisLogin:false,
		hrisLogin:false,
		dialogForm2Visible: false,
	    dialogForm1Visible: false,
		activeName:'first',
		bussinessList:[],
		bussinessShortDetail:[],
		jobByBuss:[],
		items2: [
			        {
			          title: "首页",
			          index: "/index",
			          class: "index1"
			        },
			        {
			          title: "秋招日历",
			          index: "/ftime",
			          class: "index2"
			        },
			        {
			          title: "大厂信息",
			          index: "/factory",
			          class: "index3"
			        },
			        {
			          title: "校招",
			          index: "/school",
			          class: "index4"
			        },
			        {
			          title: "offer直通车",
			          index: "/offer",
			          class: "index5"
			        }
			      ]
	},
	created(){
		this.getAllBussiness();
		
	},
	methods:{
		getBussiness(bname){
					sessionStorage.setItem("bname",bname);
					window.location.href="http://localhost:8082/usert/b";
				},
		getJobDetails(jid){
					sessionStorage.setItem("jid",jid);
					console.log(jid)
					window.location.href="http://localhost:8082/usert/j";
				},
		getBussJob(bid){
			axios.get('/manager/getJobByBuss',{
				params:{
					bid:bid
				}
			}).then(resp=>{
				this.jobByBuss = resp.data;
			}).catch();
		},
		getAllBussiness(){
			let data = new FormData();
			data.append("bname",sessionStorage.getItem("bname"));
			axios.post('/manager/getBussiness',data)
				 .then(resp=>{
					if(resp!==null){
						this.bussinessList = resp.data;
						console.log(this.bussinessList)
						this.getBussJob(this.bussinessList[0].bid);
						let temp = [];
						for(i in this.bussinessList){
							let str = new String(this.bussinessList[i].bdetails);
							temp = str.split("。");
							console.log(temp)
							this.bussinessShortDetail.push(temp[0]);
						}
					}
				})
				 .catch();
		}
	}
});